package com.chinairi.mall.controller;


import com.chinairi.common.utils.ResponseUtil;
import com.chinairi.mall.controller.viewobject.GoodsInfoVO;
import com.chinairi.mall.model.GoodsFeature;
import com.chinairi.mall.model.GoodsInfo;
import com.chinairi.mall.service.IGoodsFeatureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import com.chinairi.common.controller.BaseController;

import java.io.IOException;
import java.util.List;

/**
 * <p>
 * 商品特征量 前端控制器
 * </p>
 *
 * @author gsl
 * @since 2020-09-05
 */
@RestController
@RequestMapping("/goods-feature")
public class GoodsFeatureController extends BaseController {

    @Autowired
    private IGoodsFeatureService iGoodsFeatureService;

    /**
     * 配置特征量
     * @param goodsFeature
     * @throws IOException
     */
    @PostMapping("/config")
    public void config(GoodsFeature goodsFeature) throws IOException {
        iGoodsFeatureService.config(goodsFeature);
        ResponseUtil.showMessage("success", "特征量表配置成功", null);
    }
    /**
     * 获取特征量列表
     */
    @GetMapping("/getList")
    public void getList() throws IOException {
        List<GoodsFeature> goodsFeatureList = iGoodsFeatureService.getList();
        ResponseUtil.showMessage("success", "特征量表获取成功", goodsFeatureList);
    }
}
